home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / pdox693.zip / TI685.ASC < prev    next >
Text File  |  1992-08-25  |  7KB  |  265 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox                                NUMBER  :  685
  9.   VERSION  :  3.0 & up
  10.        OS  :  DOS
  11.      DATE  :  August 25, 1992                          PAGE  :  1/4
  12.  
  13.     TITLE  :  How to Output a Report on Selected Records of a Table
  14.  
  15.  
  16.  
  17.  
  18.   Intended Audience:
  19.   This Technical Information Sheet is intended for someone with a
  20.   moderate level of Paradox experience.
  21.  
  22.   Prerequisites:
  23.   A basic understanding of Queries and Reports.
  24.  
  25.   Purpose:
  26.   The purpose of this Technical Information Sheet is to illustrate
  27.   a method of outputting a report on selected records of a table.
  28.  
  29.   This Technical Information Sheet demonstrates a technique that
  30.   allows a user to output a report on a subset of a table.  Each of
  31.   the two examples presented below use the Customer sample table.
  32.   The first example shows how to print a report containing only
  33.   customers whose last name begins with the letter "M."  The second
  34.   example shows how to print only the first twenty customer
  35.   records.
  36.  
  37.  
  38.   Example 1:
  39.  
  40.   Printing a Report of Customers Whose Name Starts With M"
  41.  
  42.      1.  The first step requires use of a query to extract the
  43.          desired records into an Answer table.
  44.  
  45.             a.  Select {Ask} from the main menu.
  46.  
  47.             b.  When prompted for the table name, type in
  48.                 "Customer".
  49.  
  50.             c.  Next, type "M.." in the Last Name field.
  51.  
  52.                 Since ".." is the Paradox wild-card symbol, typing
  53.                 "M.." in the Last Name field will return all of the
  54.                 records with values in the Last Name field that
  55.                 start with the letter "M".
  56.  
  57.             d.  Place the cursor under the table name and press
  58.                 <F6> to place a checkmark in all of the table's
  59.                 fields.  All of the fields must be checkmarked to
  60.                 insure that the table structures of Customer and
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox                                NUMBER  :  685
  75.   VERSION  :  3.0 and up
  76.        OS  :  DOS
  77.      DATE  :  August 25, 1992                          PAGE  :  2/4
  78.  
  79.     TITLE  :  How to Output a Report on Selected Records of a Table
  80.  
  81.  
  82.  
  83.  
  84.                 Answer are the same.  This will enable the Answer
  85.                 table to use the reports from the Customer table.
  86.                 If the table structures are not identical, the
  87.                 error message "SourceTable and TargetTable don't
  88.                 have the same field names and field types" will
  89.                 appear.
  90.  
  91.             e.  Press the <F2> key to perform the query.  An Answer
  92.                 table will result.
  93.  
  94.                 NOTE: Answer tables are temporary tables and will
  95.                 be overwritten when another Answer table is
  96.                 created, when the directory is changed or when you
  97.                 exit Paradox.  If you want to save an Answer table,
  98.                 you must rename it using Tools | Rename.  When
  99.                 renaming the Answer table, be sure that the name
  100.                 you choose is not the name of an existing table.
  101.  
  102.      2.  Next, copy the report specification from the table you
  103.          queried to the Answer table using: Tools | Copy | Report |
  104.          DifferentTable.
  105.  
  106.          Following our example, from the Paradox menu select
  107.          Tools | Copy | Report | DifferentTable | Customer | 2 |
  108.          Answer | 2.
  109.  
  110.      3.  After the report has been copied from Customer to Answer,
  111.          select Report | Output | Answer | 2 | Printer from the
  112.          menu to print a report containing data for the selected
  113.          customers.
  114.  
  115.  
  116.   Example 2:
  117.  
  118.   Printing Only the First Twenty Customer Records
  119.  
  120.      1.  Make a copy of the table the report is based on.  In our
  121.          example, this is accomplished by selecting Tools | Copy |
  122.          Table | Customer from the menu.  When prompted for a new
  123.          table name, type "Cust2."
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   PRODUCT  :  Paradox                                NUMBER  :  685
  141.   VERSION  :  3.0 and up
  142.        OS  :  DOS
  143.      DATE  :  August 25, 1992                          PAGE  :  3/4
  144.  
  145.     TITLE  :  How to Output a Report on Selected Records of a Table
  146.  
  147.  
  148.  
  149.  
  150.      2.  Add a sequence number field to the table by following the
  151.          steps listed below:
  152.  
  153.             a.  Select Modify | Restructure | Cust2 from the menu.
  154.  
  155.             b.  Press <END> to move your cursor the last field.
  156.  
  157.             c.  Press <DOWN> to create a new line.
  158.  
  159.             d.  Type "RANK" in the field name column.
  160.  
  161.             e.  Type "N" in the field type column.
  162.  
  163.             f.  Press <F2> to process the restructure.
  164.  
  165.      3.  Create a script named "Counter" to place numbers into the
  166.          RANK field.
  167.  
  168.             a.  Scripts | Editor | New | Counter
  169.  
  170.                 (For Paradox versions 3.0 and 3.5, select Scripts |
  171.                 Editor |  Write | Counter)
  172.  
  173.             b.  Type in the script listed below:
  174.  
  175.                 EDIT "CUST2"  ; substitute your table name in
  176.                               ; quotes for "Cust2"
  177.                 MOVETO [RANK] ; substitute your field name for
  178.                               ; "RANK"
  179.                 SCAN
  180.                 []=RECNO()    ; put the record number in the
  181.                               ; RANK field
  182.                 ENDSCAN
  183.                 DO_IT!        ; save changes made to the table.
  184.  
  185.             c.  Press <F2> to save the script.
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.   PRODUCT  :  Paradox                                NUMBER  :  685
  207.   VERSION  :  3.0 and up
  208.        OS  :  DOS
  209.      DATE  :  August 25, 1992                          PAGE  :  4/4
  210.  
  211.     TITLE  :  How to Output a Report on Selected Records of a Table
  212.  
  213.  
  214.  
  215.  
  216.      4.  Play the script to add the numbers to the RANK field by
  217.          selecting Scripts | Play | Counter from the menu.  The
  218.          RANK field should now contain the value that equals the
  219.          corresponding record number.
  220.  
  221.      5.  Use a query to extract the first twenty records from a
  222.          table.
  223.  
  224.             a.  Select {Ask} from the menu.
  225.  
  226.             b.  When prompted for a table, type in "Cust2".
  227.  
  228.             c.  Place the cursor under the table name and press
  229.                 <F6>.  This causes all of the fields to be checked.
  230.  
  231.             d.  Type "<=20" in the RANK field of the query form.
  232.  
  233.             e.  Press <F2> to process the query.
  234.  
  235.      6.  Copy the report from Cust2 to the Answer table by
  236.          selecting Tools | Copy | Report | DifferentTable| Cust2 |
  237.          2 | Answer | 2 from the menu.
  238.  
  239.      7.  Print the report by selecting Report | Output | Answer | 2
  240.          | Printer from the menu.
  241.  
  242.  
  243.   For additional information about PAL, refer to the PAL Reference
  244.   Guide (PAL User's Guide for versions earlier than 4.0).
  245.  
  246.   DISCLAIMER: You have the right to use this technical information
  247.   subject to the terms of the No-Nonsense License Statement that
  248.   you received with the Borland product to which this information
  249.   pertains.
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.